/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package com.sc.vessel.info.model.breakdown.impl;

import com.sc.vessel.info.model.breakdown.Accident;
import com.sc.vessel.info.model.breakdown.BreakdownPackage;

import com.sc.vessel.info.model.breakdown.Component;
import com.sc.vessel.info.model.breakdown.ConfigElementSelected;
import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.emf.internal.cdo.CDOObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Accident</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link com.sc.vessel.info.model.breakdown.impl.AccidentImpl#getPhenomenon <em>Phenomenon</em>}</li>
 *   <li>{@link com.sc.vessel.info.model.breakdown.impl.AccidentImpl#getProcess <em>Process</em>}</li>
 *   <li>{@link com.sc.vessel.info.model.breakdown.impl.AccidentImpl#getAnalyze <em>Analyze</em>}</li>
 *   <li>{@link com.sc.vessel.info.model.breakdown.impl.AccidentImpl#getExperience <em>Experience</em>}</li>
 *   <li>{@link com.sc.vessel.info.model.breakdown.impl.AccidentImpl#getComponent <em>Component</em>}</li>
 *   <li>{@link com.sc.vessel.info.model.breakdown.impl.AccidentImpl#getConfigElements <em>Config Elements</em>}</li>
 *   <li>{@link com.sc.vessel.info.model.breakdown.impl.AccidentImpl#getItemId <em>Item Id</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class AccidentImpl extends CDOObjectImpl implements Accident {
    /**
     * The default value of the '{@link #getPhenomenon() <em>Phenomenon</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPhenomenon()
     * @generated
     * @ordered
     */
    protected static final String PHENOMENON_EDEFAULT = null;

    /**
     * The default value of the '{@link #getProcess() <em>Process</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getProcess()
     * @generated
     * @ordered
     */
    protected static final String PROCESS_EDEFAULT = null;

    /**
     * The default value of the '{@link #getAnalyze() <em>Analyze</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getAnalyze()
     * @generated
     * @ordered
     */
    protected static final String ANALYZE_EDEFAULT = null;

    /**
     * The default value of the '{@link #getExperience() <em>Experience</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getExperience()
     * @generated
     * @ordered
     */
    protected static final String EXPERIENCE_EDEFAULT = null;

    /**
     * The default value of the '{@link #getItemId() <em>Item Id</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getItemId()
     * @generated
     * @ordered
     */
    protected static final String ITEM_ID_EDEFAULT = null;

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected AccidentImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return BreakdownPackage.Literals.ACCIDENT;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected int eStaticFeatureCount() {
        return 0;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getPhenomenon() {
        return (String)eDynamicGet(BreakdownPackage.ACCIDENT__PHENOMENON, BreakdownPackage.Literals.ACCIDENT__PHENOMENON, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setPhenomenon(String newPhenomenon) {
        eDynamicSet(BreakdownPackage.ACCIDENT__PHENOMENON, BreakdownPackage.Literals.ACCIDENT__PHENOMENON, newPhenomenon);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getProcess() {
        return (String)eDynamicGet(BreakdownPackage.ACCIDENT__PROCESS, BreakdownPackage.Literals.ACCIDENT__PROCESS, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setProcess(String newProcess) {
        eDynamicSet(BreakdownPackage.ACCIDENT__PROCESS, BreakdownPackage.Literals.ACCIDENT__PROCESS, newProcess);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getAnalyze() {
        return (String)eDynamicGet(BreakdownPackage.ACCIDENT__ANALYZE, BreakdownPackage.Literals.ACCIDENT__ANALYZE, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setAnalyze(String newAnalyze) {
        eDynamicSet(BreakdownPackage.ACCIDENT__ANALYZE, BreakdownPackage.Literals.ACCIDENT__ANALYZE, newAnalyze);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getExperience() {
        return (String)eDynamicGet(BreakdownPackage.ACCIDENT__EXPERIENCE, BreakdownPackage.Literals.ACCIDENT__EXPERIENCE, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setExperience(String newExperience) {
        eDynamicSet(BreakdownPackage.ACCIDENT__EXPERIENCE, BreakdownPackage.Literals.ACCIDENT__EXPERIENCE, newExperience);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public Component getComponent() {
        return (Component)eDynamicGet(BreakdownPackage.ACCIDENT__COMPONENT, BreakdownPackage.Literals.ACCIDENT__COMPONENT, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public Component basicGetComponent() {
        return (Component)eDynamicGet(BreakdownPackage.ACCIDENT__COMPONENT, BreakdownPackage.Literals.ACCIDENT__COMPONENT, false, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setComponent(Component newComponent) {
        eDynamicSet(BreakdownPackage.ACCIDENT__COMPONENT, BreakdownPackage.Literals.ACCIDENT__COMPONENT, newComponent);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @SuppressWarnings("unchecked")
    public EList<ConfigElementSelected> getConfigElements() {
        return (EList<ConfigElementSelected>)eDynamicGet(BreakdownPackage.ACCIDENT__CONFIG_ELEMENTS, BreakdownPackage.Literals.ACCIDENT__CONFIG_ELEMENTS, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getItemId() {
        return (String)eDynamicGet(BreakdownPackage.ACCIDENT__ITEM_ID, BreakdownPackage.Literals.ACCIDENT__ITEM_ID, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setItemId(String newItemId) {
        eDynamicSet(BreakdownPackage.ACCIDENT__ITEM_ID, BreakdownPackage.Literals.ACCIDENT__ITEM_ID, newItemId);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case BreakdownPackage.ACCIDENT__CONFIG_ELEMENTS:
                return ((InternalEList<?>)getConfigElements()).basicRemove(otherEnd, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case BreakdownPackage.ACCIDENT__PHENOMENON:
                return getPhenomenon();
            case BreakdownPackage.ACCIDENT__PROCESS:
                return getProcess();
            case BreakdownPackage.ACCIDENT__ANALYZE:
                return getAnalyze();
            case BreakdownPackage.ACCIDENT__EXPERIENCE:
                return getExperience();
            case BreakdownPackage.ACCIDENT__COMPONENT:
                if (resolve) return getComponent();
                return basicGetComponent();
            case BreakdownPackage.ACCIDENT__CONFIG_ELEMENTS:
                return getConfigElements();
            case BreakdownPackage.ACCIDENT__ITEM_ID:
                return getItemId();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @SuppressWarnings("unchecked")
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case BreakdownPackage.ACCIDENT__PHENOMENON:
                setPhenomenon((String)newValue);
                return;
            case BreakdownPackage.ACCIDENT__PROCESS:
                setProcess((String)newValue);
                return;
            case BreakdownPackage.ACCIDENT__ANALYZE:
                setAnalyze((String)newValue);
                return;
            case BreakdownPackage.ACCIDENT__EXPERIENCE:
                setExperience((String)newValue);
                return;
            case BreakdownPackage.ACCIDENT__COMPONENT:
                setComponent((Component)newValue);
                return;
            case BreakdownPackage.ACCIDENT__CONFIG_ELEMENTS:
                getConfigElements().clear();
                getConfigElements().addAll((Collection<? extends ConfigElementSelected>)newValue);
                return;
            case BreakdownPackage.ACCIDENT__ITEM_ID:
                setItemId((String)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case BreakdownPackage.ACCIDENT__PHENOMENON:
                setPhenomenon(PHENOMENON_EDEFAULT);
                return;
            case BreakdownPackage.ACCIDENT__PROCESS:
                setProcess(PROCESS_EDEFAULT);
                return;
            case BreakdownPackage.ACCIDENT__ANALYZE:
                setAnalyze(ANALYZE_EDEFAULT);
                return;
            case BreakdownPackage.ACCIDENT__EXPERIENCE:
                setExperience(EXPERIENCE_EDEFAULT);
                return;
            case BreakdownPackage.ACCIDENT__COMPONENT:
                setComponent((Component)null);
                return;
            case BreakdownPackage.ACCIDENT__CONFIG_ELEMENTS:
                getConfigElements().clear();
                return;
            case BreakdownPackage.ACCIDENT__ITEM_ID:
                setItemId(ITEM_ID_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case BreakdownPackage.ACCIDENT__PHENOMENON:
                return PHENOMENON_EDEFAULT == null ? getPhenomenon() != null : !PHENOMENON_EDEFAULT.equals(getPhenomenon());
            case BreakdownPackage.ACCIDENT__PROCESS:
                return PROCESS_EDEFAULT == null ? getProcess() != null : !PROCESS_EDEFAULT.equals(getProcess());
            case BreakdownPackage.ACCIDENT__ANALYZE:
                return ANALYZE_EDEFAULT == null ? getAnalyze() != null : !ANALYZE_EDEFAULT.equals(getAnalyze());
            case BreakdownPackage.ACCIDENT__EXPERIENCE:
                return EXPERIENCE_EDEFAULT == null ? getExperience() != null : !EXPERIENCE_EDEFAULT.equals(getExperience());
            case BreakdownPackage.ACCIDENT__COMPONENT:
                return basicGetComponent() != null;
            case BreakdownPackage.ACCIDENT__CONFIG_ELEMENTS:
                return !getConfigElements().isEmpty();
            case BreakdownPackage.ACCIDENT__ITEM_ID:
                return ITEM_ID_EDEFAULT == null ? getItemId() != null : !ITEM_ID_EDEFAULT.equals(getItemId());
        }
        return super.eIsSet(featureID);
    }

} //AccidentImpl
